package com.hanson.controller;

import com.hanson.annotation.Log;
import com.hanson.common.api.CommonResult;
import com.hanson.common.exception.APIException;
import com.hanson.pojo.vo.City;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @classname: TestController
 * @author: Hanson
 * @create: 2021/01/08
 **/
@Log
@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/1")
    public Object test1(){
        return new CommonResult<String>("测试不处理全局返回结果");
    }
    @GetMapping("/2")
    public Object test2(){
        return new City(1,"10","shenzhen","100");
    }
    @GetMapping("/3")
    public Object test3(){
            throw new APIException();
    }
}
